package com.test.study;

import com.test.study.discovery.DiscoveryWithZk;
import com.test.study.discovery.IDiscovery;

import java.lang.reflect.Proxy;

public class GpRpcClientProxy {
	
	private Class<?> clz;

	static IDiscovery discovery = new DiscoveryWithZk();

	public static <T> T create(Class<T> clz) {
		GpRpcClientInvoke handler = new GpRpcClientInvoke(clz,discovery);
		Object instance = Proxy.newProxyInstance(clz.getClassLoader(),new Class<?>[]{clz}, handler);
		return (T) instance;
	}
	
	

}
